<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.css" rel="stylesheet" />
		<link href="../../css/list.css" rel="stylesheet" />
		<script src="../../js/mui.min.js"></script>
		 <script src="../../js/app.js"></script>
		 <link href="../../css/style.css" rel="stylesheet" />
<!--		 <link href="../css/icons-extra.css" rel="stylesheet"/>-->
<link rel="stylesheet" href="../css/detail.css" type="text/css" />
		 		<script src="../js/common.js"></script>
		 		<style type="text/css">

		 		</style>
</head>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  <h1 class="mui-title"><span id="title">预约详情</span></h1><p id="titleright" style="float: right;font-size: 0.6em;"></p>
</header>

    <div class="mui-content">

    <li class="mui-content-padded" id="user"></li>
<!--    <div class="slide-box" id="user"></div>-->
    <!--出品公司-->
      <!--项目概况表格-->
    <div id="table" class="mui-content-padded"></div>
     <li class="mui-content-padded"id="source"></li>
      <!--来源-->
    </div>
<script type="text/javascript">

 //获取详情
function jsonarrfor(result){

var str=JSON.stringify(result);
	casestate='<span style="color:#00EE00;">●</span><span style="border-radius:25px;border:2px solid #a1a1a1;padding:2px 5px">'+result.username+'</span>';

switch(result.relation){
		case 'resume':
		var relation='技术入股';
		  break;
		case 'money':
		var relation='资金入股';
		  break;
		  case 'source':
		var relation='资源入股';
		  break;
		  case 'item':
		  var relation='项目入股';
		  break;
		default:
		var relation='其他';
		}

switch(result.status){
		case 1:
		var status='待甲方确认';
		  break;
		case 2:
		var status='签约完毕';
		  break;
		  case 3:
		var status='未知';
		  break;
		  case 5:
		  var status='已完成';
		
		  break;
		default:
		var status='待签约';
		}
//发布日期
var createtime=new Date(parseInt(result.createtime) * 1000).format('yyyy年M月d日');
val='<div style="text-align:center"><h3>项目名称:'+result.title+'</h3><p  style="background: transparent;" onclick="goto(\'chat\',\'home\',\'detail\','+result.user_id+')">联系对方：'+casestate+'</p><h4>项目简介</h4><p><span id="synopsis">'+result.synopsis+'</span></p></div>';
//形象头像

//判断筹备进度达到100%屏蔽表格

	var table='<li style="border-bottom:solid 1px #333;"><span id="situation">预约编号：</span><span>'+result.code+'</span></li><div class="list-head" ><table><tr><td width="110px">项目名称</td><td>'+result.title+'</td></tr><tr><td width="110px">入股方式</td><td>'+relation+'</td></tr><tr><td width="110px">合作状态</td><td>'+status+'</td></tr><tr><td>签约日期</td><td>'+createtime+'</td></tr><tr><td>预估单价</td><td>'+result.moneyunit+'元</td></tr><tr><td>下单总数</td><td>'+result.sum+'股</td></tr><tr><td>合计</td><td>'+(result.sum*result.moneyunit/10000)+'万</td></tr><tr><td>乙方备注</td><td>'+result.notes+'</td></tr></table></div>';

document.getElementById('table').innerHTML=table;
document.getElementById('user').innerHTML=val;
document.getElementById('source').innerHTML='预约日期:'+createtime
//document.getElementById('source').innerHTML='<p style="border-bottom:solid 1px #333;"><span>发布人:'+result.username+'</span><span style="margin-left:20px">发布于：'+createtime+'</span></p>';
//document.getElementById('titleright').innerHTML='<div id="report" style="margin-top:10px;float:right"></div><div style="float:right"><select style="padding:10px;background-color:transparent;" onchange="report('+result.id+',\'item\',this)"><option>投诉</option><option>色情</option><option>侵权</option><option>脏话</option><option>诽谤</option><option>低俗</option><option>虚假</option><option>其他</option></select></div>';
}


apptoken['tid']=tid;//获取主题详情id
apptoken['act']='detail';
mui.post(home.hos+'/item_orders/admin?tid='+apptoken['tid'],apptoken,function(data){
//	alert("管理服务器"+data+apptoken['tid']);
	if(isJSON(data)){
//      			alert(data);
		result=JSON.parse(data);//获取信息
		jsonarrfor(result);//加载详情信息
		}else{
			alert(apptoken['tid']+'页面加载失败，或不存在，请重新尝试');
			return false;
    	}
})

function goto(module,room,htmlname,this_id){//我的微博
	localStorage[module+room+htmlname+'id']=this_id;
	mui.openWindow('../../'+module+'/'+room+'/'+htmlname+'.html');
	}
  </script>